package com.woniuxy.controller;

import com.woniuxy.entity.Perm;
import com.woniuxy.entity.Role;
import com.woniuxy.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("role")
public class RoleController {
    @Autowired
    RoleService roleService;
    @RequestMapping("findAll")
    public List<Role> findAll(){

        return roleService.findAll();
    }
    @RequestMapping("findPerm")
    public List<Perm> findPermByRoleId(@RequestBody String json){
        return roleService.findPermByRoleId(json);
    }
}
